<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules//vue/dist/vue.js"></script>
    <script src="./node_modules/axios/dist/axios.js"></script>
</head>

<body>
    <div id="app">
        <select  v-model="selectPro">
            <option value="">-选择省份-</option>
            <option :value="index" v-for="(item,index) in province" :key="index">{{item}}</option>
        </select>
        <select v-model="selectCity",@change="changeList">
            <option value="">-选择城市-</option>
            <option :value="item" v-for="(item,index) in city[selectPro]" :key="index">{{item}}</option>
        </select>
    </div>
</body>
<script>
    new Vue({
        el: '#app',
        data: {
            selectPro:'',
            selectCity:'',
            province:["福建省","广东省"],
            city:[
                ["福州市","厦门市","泉州市"],
                ["广州市","中山市","深圳市"]
            ]
        },
        
        methods: {
            changeList(){
                console.log(this.selectCity,this.province[this.selectPro]);
                this.getData(this.selectCity,this.province[this.selectPro])
            },
            getData(province,city) {

                axios.get("https://v2.alapi.cn/api/springTravel/risk",
                    {
                        params: { token: 'ssWu3bM8uLWuX4Vf',
                        province,
                        city,
                    }

                    }).then(res=>{
                        console.log(res.data)
                    })
            }
        },
    })

</script>

</html>